import pymysql

conn=pymysql.connect(host="192.168.88.128", port=3306,user="root" , passwd="123456",
                       database="test_db", charset="utf8")
cursor=conn.cursor()
sql="update t_book set `read`=`read`+1 where id=3"
cursor.execute(sql)
sql3="delete from t_book where id=2"
cursor.execute(sql3)
conn.commit()

sql2="select * from t_book"
cursor.execute(sql2)
cursor.rownumber=0
# 必须要变量保存 才可以打印出元组
c=cursor.fetchmany(2)
print(c)

cursor.close()
conn.close()